<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>联豆管理-用户详情</title>
    <link rel="stylesheet"  type="text/css"  href="/lib/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="/css/lduserdesc.css">
    <style>

    </style>
</head>
<body>
<div class="panel panel-default">
    <div class="panel-heading ">联豆管理-用户详情</div>
    {foreach $userOrders as $item}
    <div class="panel-body">
        <div class="left col-sm-3 col-sm-offset-1">
            <div>
                <h3 class="title">个人信息</h3>

                <div class="content col-sm-offset-1" >
                    <ul>
                        <li><span>真实姓名：</span><span>{$item->user_name}</span></li>
                        {if condition="$item->orderBeanAccount->isEmpty()"}
                        <li><span>联豆订单号：</span><span>暂无联豆订单</span></li>
                        {else /}
                        <li><span>联豆订单号：</span><span>{$item->orderBeanAccount->toArray()[0]['order_num']}</span></li>
                        {/if}

                        <li><span>手机号：</span><span>{$item->iphone}</span></li>

                        {if condition="$item->bankAccount->isEmpty()"}
                        <li><span>银行账号：</span><span>未绑定银行账号</span></li>
                        {elseif condition="(count($item->bankAccount->toArray()) eq 1) AND ($item->bankAccount->toArray()[0]['bind_staff'] eq 0)"/}
                        <li><span>银行账号：</span><span>{$item->bankAccount->toArray()[0]['bank_num']}</span></li>
                        {elseif condition="count($item->bankAccount->toArray())>1" /}
                        {foreach name="($item->bankAccount->toArray())" item="it"}
                        {if condition="$it['bind_staff'] == 0"}
                        <li><span>银行账号：</span><span>{$item->bankAccount->toArray()[0]['bank_num']}</span></li>
                        <?php break; ?>
                        {/if}
                        {/foreach}
                        {/if}
                    </ul>
                </div>
            </div>
            <div style="margin-top: 30px">
                <h3 class="title">用户明细</h3>
                <div class="content col-sm-offset-1" >
                    {if condition="$item->orderBeanAccount->isEmpty()"}
                    <ul>
                        <li><span>累计充值：</span><span><i>0</i>联豆</span></li>
                        <li><span>累计消费：</span><i>¥<i>0</i></i></li>
                        <li><span>累计提现：</span><span><i>0</i>联豆</span></li>
                        <li><span>累计提现金额：</span><span>¥ <i>0</i></span></li>
                    </ul>
                    {else /}
                    <ul>
                        <li><span>累计充值：</span><span><i>{$rechargeBeans}</i>联豆</span></li>
                        <li><span>累计消费：</span><i>¥<i>{$rechargeMoney}</i></i></li>
                        <li><span>累计提现：</span><span><i>{$withdrawBeans}</i>联豆</span></li>
                        <li><span>累计提现金额：</span><span>¥ <i>{$withdrawMoney}</i></span></li>
                    </ul>
                    {/if}
                </div>
            </div>
        </div>
        <div class="right col-sm-7">
            <div>
                <ul class="nav nav-tabs" role="tablist">
                    <li role="presentation" ><a href="{:url('admin/beans/beansShow',['username'=>$item['username']])}" >全部订单({$orders|count})</a></li>
                    <li role="presentation" class="active"><a href="{:url('admin/beans/userRechargeOrder',['username'=>$item['username']])}">充值({$rechargeOrders|count})</a></li>
                    <li role="presentation"><a href="{:url('admin/beans/userWithdrawOrder',['username'=>$item['username']])}" >提现({$withdrawOrders|count})</a></li>
                </ul>
                <div class="tab-content">
                    <div role="tabpanel" class="tab-pane active" id="all">

                        <ul class="list-group">
                            {if condition="$rechargeOrders->isEmpty()"}
                            <li class="list-group-item ">
                                <div class="clearfix">
                                    暂无充值订单
                                </div>
                            </li>
                            {else /}
                            {foreach $rechargeOrders as $order}
                            <li class="list-group-item ">
                                <div class="clearfix">
                                    <div class="pull-left">
                                        <p class="item">¥<i>{$order['order_money']}</i>充值为 <i>{$order['beans_num']}</i>联豆 (<i>{$order['create_time']}</i>)</p>
                                        <p class="item">联豆订单号：<i>{$order['order_num']}</i></p>
                                    </div>
                                    <div class="pull-right">
                                        {if condition="$order['order_staff'] == 1"}
                                        <p class="shouli danger" >未受理</p>
                                        {elseif condition="$order['order_staff'] == 2"}
                                        <p class="shouli primary" >受理中</p>
                                        {elseif condition="$order['order_staff'] == 4"}
                                        <p class="shouli primary" >受理失败</p>
                                        {else /}
                                        <p class="shouli success" >已受理</p>
                                        {/if}
                                    </div>
                                </div>
                            </li>
                            {/foreach}
                            {/if}
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>
    {/foreach}
</div>
<script src="/lib/jquery/jquery.js"></script>
<script src="/lib/bootstrap/js/bootstrap.min.js"></script>
</body>
</html>